package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

    @RestController("userShopController")
    @RequestMapping("/user/shop")
    @Slf4j
    @Api(tags = "营业状态相关接口")
    public class shopController {

        @Autowired
        private RedisTemplate redisTemplate;

        @ApiOperation("用户获取店铺的营业状态")
        @GetMapping("/status")
        public Result<Integer> getShopStatus(){
            Integer Status = (Integer) redisTemplate.opsForValue().get("status");
            log.info("当前的营业状态是：{}",Status==1?"当前正在营业":"当前暂停营业");
            return Result.success(Status);
        }
    }


